#pragma once
#ifndef Game_GraphicsPipeline_GraphicsPipeline9_h
#define Game_GraphicsPipeline_GraphicsPipeline9_h

#include "GraphicsPipelineBase.h"

namespace Game {
namespace GraphicsPipeline {

class GraphicsPipeline9 : public GraphicsPipelineBase {
public:
    GraphicsPipeline9(IDirect3DDevice9* pd3dDevice);
    virtual ~GraphicsPipeline9();

    virtual void Finalize();
    virtual void Initialize();
    void FrameRender(IDirect3DDevice9* pd3dDevice, const double& fTime, const float& fElapsedTime);

    static void CALLBACK D3D9DeviceLostCallback(void* pUserContext);
    static HRESULT CALLBACK D3D9DeviceResetCallback(IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext);
    static void CALLBACK D3D9FrameRenderCallback(IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext);
private:
    IDirect3DDevice9* d3dDevice;

    void OnDeviceLost();
    HRESULT OnDeviceReset(IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc);
};

}

}

#endif
